module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        less: {
            views: {
                expand: true,
                cwd: 'views/',
                src: '**/*.less',
                dest: 'views/',
                ext: '.css'
            },
            fullpage: {
                files: [{
                    src: './views/fullpage/index.less',
                    dest: './views/fullpage/index.css'
                }]
            }
        },
        autoprefixer: {
            views: {
                expand: true,
                cwd: 'views/',
                src: '**/*.css',
                dest: 'views/',
                ext: '.css'
            }
        },
        watch: {
            files: 'views/**/*.less',
            tasks: 'default'
        }
    });

    // 加载插件
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-autoprefixer');
    grunt.loadNpmTasks('grunt-contrib-watch');

    // 默认任务
    grunt.registerTask('default', ['less', 'autoprefixer']);
};